# -*- coding: utf-8 -*-
from django.conf.urls import url, include
from .views import *

sale_list = SaleListViewSet.as_view({
    'get': 'list',
    'post': 'create',  # 自动生成html表单
})

purchase_list = PurchaseListViewSet.as_view({
    'get': 'list',
    'post': 'create',
})

goodinsale_list = GoodInSaleListViewSet.as_view({
    'get': 'list',
    'post': 'create',
})

goodinpurchase_list = GoodInPurchaseListViewSet.as_view({
    'get': 'list',
    'post': 'create',
})

salecomment_list = SaleCommentListViewSet.as_view({
    'get': 'list',
    'post': 'create',
})

goodcomment_list = GoodCommentListViewSet.as_view({
    'get': 'list',
    'post': 'create',
})

refund_list = RedundListViewSet.as_view({
    'get': 'list',
    'post': 'create',
})

# `create()`, `retrieve()`, `update()`,`partial_update()`, `destroy()` and `list()`actions.

urlpatterns = [
    url(r'^sales/$', sale_list),
    url(r'^purchases/$', purchase_list),
    url(r'^goodsinsale/$', purchase_list),
    url(r'^goodsinpurchase/$', purchase_list),
    url(r'^goodcomments/$', purchase_list),
    url(r'^salecomments/$', purchase_list),
    url(r'^refunds/$', purchase_list),
]
